/*
 * @(#) WorkPlanService.java 2013-5-28 下午1:58:47
 *
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.im;

import java.util.Vector;

import pnuts.lang.Context;

import com.datasweep.compatibility.client.Part;
import com.datasweep.compatibility.client.PartFilter;
import com.datasweep.compatibility.client.Response;
import com.datasweep.compatibility.pnuts.Functions;
import com.osi.mes.base.BaseService;

public class PartService extends BaseService
{

	public PartService(Context context)
	{
		super(context);
	}

	public PartService(Functions functions)
	{
		super(functions);
	}
	
	@SuppressWarnings("unchecked")
	public Vector<Part> getParts(PartFilter partFilter)
	{
		return getFunctions().getFilteredParts(partFilter);
	}
	
	public Response savePart(Part part)
	{
		return part.save();
	}
	
	public Response deletePart(Part part)
	{
		return part.delete(getFunctions().getDBTime(), null);
	}
}
